import type { App } from 'vue'
import type { ComponentMyodules } from '@/types/components/index.ts'

const icons: ComponentMyodules = import.meta.glob('./Icons/*.vue', { eager: true })

export default {
  install(app: App) {
    Object.keys(icons).forEach((key: string) => {
      const name = key.match(/\/([^/]+)\.vue$/)![1]
      app.component(name, icons[key].default)
    })
  },
}
